//
//  SudoKuListCell.m
//  UI16.真.豆瓣
//
//  Created by dllo on 15/11/2.
//  Copyright © 2015年 Amydom. All rights reserved.
//

#import "SudoKuListCell.h"
#import "AppTools.h"
#import "UIImageView+WebCache.h"

@interface SudoKuListCell ()

@property (nonatomic, retain) UIImageView *photoImageView;
@property (nonatomic, retain) UILabel *nameLabel;

@end


@implementation SudoKuListCell

-(void)dealloc{
    [_photoImageView release];
    [_nameLabel release];
    [super dealloc];
    
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{

    
    self.photoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 85, 130)];
    self.photoImageView.image = [UIImage imageNamed:@"picholder.png"];
    [self addSubview:self.photoImageView];
    [_photoImageView release];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 145, 75, 10)];
    self.nameLabel.text = @"啦啦啦啦啦啦啦";
    self.nameLabel.font = [UIFont systemFontOfSize:12];
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    self.nameLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
    [self addSubview:self.nameLabel];
    [_nameLabel release];



}

- (void)setMyMovie:(Movie *)myMovie{
    if (_myMovie != myMovie) {
        [_myMovie release];
        _myMovie = [myMovie retain];
    }
    self.nameLabel.text = self.myMovie.movieName;
    [self.photoImageView sd_setImageWithURL:[NSURL URLWithString:self.myMovie.pic_url] placeholderImage:[UIImage imageNamed:@"picholder.png"]];
}

//- (void)layoutSubviews
//{
//    [super layoutSubviews];
//}

@end
